package com.esri.core.internal.tasks.ags;

import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.UserCredentials;
import com.esri.core.portal.PortalUser;

/* loaded from: classes.dex */
public class ag extends com.esri.core.internal.tasks.d<PortalUser> {
    private static final long serialVersionUID = 1;

    public ag(al alVar, String str, UserCredentials userCredentials) {
        this(alVar, str, userCredentials, null);
    }

    public ag(al alVar, String str, UserCredentials userCredentials, TaskListener<PortalUser> taskListener) {
        super(alVar, a(str, userCredentials), userCredentials, taskListener);
    }

    private static final String a(String str, UserCredentials userCredentials) {
        return str + "/community/users/" + userCredentials.getUserName();
    }

    @Override // com.esri.core.internal.tasks.a
    /* renamed from: a */
    public PortalUser execute() throws Exception {
        if (this.credentials == null || this.credentials.getUserName() == null) {
            return null;
        }
        return PortalUser.fromJson(com.esri.core.internal.io.handler.h.a(this.serviceURL, this.actionInput.generateRequestParams(), getServiceCredentials()), ((al) getActionInput()).a);
    }
}
